package com.example.bawolf.effctivejava.bean;

import javafx.util.Builder;
import lombok.Data;

/**
 * @author zhougf
 * @version 1.0
 * @date 2020/03/13
 */
@Data
public class TestBean {
    private String name;

    private String age;

    private String address;

    private String mobile;

    private String birthday;

    public static class Builder {
        private String name;
        private String age;
        private String address = "address";
        private String mobile;
        private String birthday;

        public Builder(String name) {
            this.name = name;
        }

        public Builder age(String age) {
            this.age = age;
            return this;
        }

        public Builder address(String address) {
            this.address = address;
            return this;
        }

        public Builder mobile(String mobile) {
            this.mobile = mobile;
            return this;
        }

        public Builder birthday(String birthday) {
            this.birthday = birthday;
            return this;
        }

        public TestBean build() {
            return new TestBean(this);
        }
    }

    private TestBean(Builder builder) {
        this.address = builder.address;
        this.name = builder.name;
        this.mobile = builder.mobile;
        this.age = builder.age;
        this.birthday = builder.birthday;
    }

    public String getName() {
        return name;
    }

    public String getAge() {
        return age;
    }

    public String getAddress() {
        return address;
    }

    public String getMobile() {
        return mobile;
    }

    public String getBirthday() {
        return birthday;
    }
}
